using System;
using System.Linq;

namespace Limestone
{
    public class PageHelper
    {
        /// <summary>
        /// Extracts the parent path out of a path.
        /// </summary>
        /// <param name="path"></param>
        /// <returns></returns>
        public static string GetParentPath(string path)
        {
            var idx = path.LastIndexOf(@"/", StringComparison.Ordinal);
            if (idx < 1)
                return "/";
            return path.Substring(0, idx);
        }

    }
}